<?php
include_once("match_repository.php");
$repMatch= new MatchRepository;
$playersT2New=array($_POST['player1T2'],$_POST['player2T2'],$_POST['player3T2']);
$playersT2Old=array($_POST['player1T2_old'],$_POST['player2T2_old'],$_POST['player3T2_old']);
$scaduleId=$_POST['scaduleId'];
for($i=0;$i<3;$i++){
	if ($playersT2New[$i]!=$playersT2Old[$i]){
		$repMatch->updateMatchPlayer2($scaduleId,$playersT2Old[$i],$playersT2New[$i]);
	}
}

header('LOCATION:'.$_SERVER["HTTP_REFERER"]);
?>